<link rel="stylesheet" href="__MOBILE__/css/jquery.Jcrop.min.css" type="text/css">

<div class="container col-thin" ng-controller="resumeProfileController">
    <!--<div class="row col-resume-head">-->
        <!--<div class="col-xs-3">-->
            <!--<a href="#" class="logo"></a>-->
        <!--</div>-->
        <!--<div class="col-xs-9">-->
            <!--<h4>资料完善</h4>-->
            <!--<p>-->
                <!--<empty name="Think.session.loginUser">-->
                    <!--使用全部功能请<a href="<{:U('Login/index')}>">登 陆</a>或<a href="<{:U('Register/index')}>">注 册</a></p>-->
            <!--<else />-->
            <!--hi，<{$Think.session.loginUser.user_name}>。初次见面，活宝这厢有礼了！-->
            <!--</empty>-->
            <!--</p>-->
        <!--</div>-->
    <!--</div>-->

    <div class="row">
        <div class="col-xs-12 col-panel-profile">
            <h5>个人资料</h5>
        </div>
    </div>

    <!-- Base info -->
    <div class="row">
        <div class="col-xs-12 wrap-col-cont center">
            <div class="wrap-avatar">
                <iframe name="iframebox" src="" style="display:none" ></iframe>
                <form name="uploadForm" action="<{:U('Upload/img')}>"
                      target="iframebox" enctype="multipart/form-data" method="post" >
                    <input type="file" id="image_file" name="avatar" class="input-imgfile"
                           onchange="fileSelectHandler();">

                    <!-- hidden crop params -->
                    <input type="hidden" id="x1" name="start_x" value="0"/>
                    <input type="hidden" id="y1" name="start_y" value="0" />
                    <input type="hidden" id="w" name="length_x" value="0"/>
                    <input type="hidden" id="h" name="length_y" value="0"/>


                </form>
                <img id="avatar" ng-src="__UPLOAD__/{{ user.image_url }}" width="100px" height="100px">
            </div>
        </div>
    </div>

    <script>
        function uploadImgCheck() {
            var exp = /.jpg$|.jpeg$|.gif$|.png$|.bmp$/;
            var file = document.uploadForm.avatar.files[0];
            if (file.size > 5 * 1024 * 1024) {
                alert("上传图片不能超过5M");
                return;
            }
            if (!exp.exec(file.type)) {
                alert("图片格式不正确");
                return;
            }
            document.uploadForm.submit();
            $('#uploadModal').modal('hide');
        }
        // Update from server script
        function updateImg(res) {
            var appElement = document.querySelector('[ng-controller=resumeProfileController]');
            if (res.msg != null) {
                angular.element(appElement).scope().
                        imgChange(res.msg.url);
            } else if (res.err != null) {
                alert(res.err);
            }
        }
    </script>

    <form class="form-horizontal col-normal" role="form" novalidate>
        <div class="form-group">
            <div class="col-xs-offset-3 col-xs-9">
                <div class="checkbox">
                    <label>
                        <input type="checkbox" ng-model="isPublicPhone">公开电话号码</a>
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label for="inputName" class="col-xs-3 control-label sm-label">真实姓名</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" id="inputName" ng-model="user.user_name" placeholder="填写真实姓名，增加可信度">
            </div>
        </div>
        <div class="form-group">
            <label for="radioSex1" class="col-xs-3 control-label sm-label">性别</label>
            <div class="col-xs-9">
                <label class="radio-inline">
                    <input type="radio" name="sex" id="radioSex1" value="1" ng-model="user.sex">男
                </label>
                <label class="radio-inline">
                    <input type="radio" name="sex" id="radioSex2" value="2" ng-model="user.sex">女
                </label>
            </div>
        </div>

        <div class="form-group">
            <label for="inputBirthday" class="col-xs-3 control-label sm-label">出生日期</label>
            <div class="col-xs-9">
                <input type="date" class="form-control" id="inputBirthday" ng-model="birthday">
            </div>
        </div>
        <!--<div class="form-group">-->
            <!--<div class="col-xs-offset-3 col-xs-9">-->
                <!--<div class="checkbox">-->
                    <!--<label>-->
                        <!--<input type="checkbox" ng-model="isPublicBirthday">公开年份，日月保密</a>-->
                    <!--</label>-->
                <!--</div>-->
            <!--</div>-->
        <!--</div>-->
        <div class="form-group">
            <label for="inputAddr1" class="col-xs-3 control-label sm-label">现居住地</label>
             <div id="inputAddr1" class="col-xs-4">
                     <select id="selectP" class="form-control" ng-change="cascade()" ng-model="province" ng-options="m for m in provinces">
                         <option value="">--省份--</option>
                     </select>
             </div>
             <div class="col-xs-5">
                 <select class="form-control" ng-model="city" ng-options="m for m in cities">
                     <option value="">--城市--</option>
                 </select>
             </div>
        </div>
        <div class="form-group">
            <label for="inputDegreeY" class="col-xs-3 control-label sm-label">学历信息</label>
            <div id="inputDegreeY" class="col-xs-4">
                <select class="form-control" ng-model="user.degree_year" ng-options="m.value as m.value for m in degreeYears">
                    <option value="">--请选择--</option>
                </select>
                <span style="position: absolute;right: -4px;top: 8px;">级</span>
            </div>
            <!--<div class="col-xs-4">-->
                <!--<div class="checkbox">-->
                    <!--<label>-->
                        <!--<input type="checkbox" ng-model="isPublicDegree">公开学历信息</a>-->
                    <!--</label>-->
                <!--</div>-->
            <!--</div>-->
        </div>
        <div class="form-group">
            <div class="col-xs-offset-3 col-xs-9">
                <input type="text" class="form-control" ng-model="user.degree_school" placeholder="院校名称">
            </div>
        </div>
        <div class="form-group">
            <div class="col-xs-offset-3 col-xs-9">
                <input type="text" class="form-control" ng-model="user.degree_major" placeholder="专业名称">
            </div>
        </div>
        <!--<div class="form-group">-->
            <!--<div class="col-xs-12">-->
                <!--<p class="text-tips">学历信息只开放填写一所学校/专业，多项学位证书者，建议择优填写，同一院校就读过多专业，可如下：-->
                    <!--图片摄影/院线管理。</p>-->
            <!--</div>-->
        <!--</div>-->

        <!-- Agent info -->
        <div class="form-group">
            <div class="col-xs-12 col-panel-profile">
                <h5>公司信息</h5>
            </div>
        </div>

        <div class="form-group">
            <label for="inputAgentJ" class="col-xs-3 control-label sm-label">公司名称</label>
            <div class="col-xs-9">
                <input type="text" class="form-control" id="inputAgentJ" ng-model="user.agent_j" placeholder="选填">
            </div>
        </div>
        <div class="form-group">
            <label for="inputAgentDescY" class="col-xs-3 control-label sm-label">公司简介</label>
            <div class="col-xs-9">
                <textarea rows="4" class="form-control" id="inputAgentDescY" ng-model="user.agent_j_desc" placeholder="机构规模、人数、代表作品等"></textarea>
            </div>
        </div>

        <!--<div class="form-group">-->
            <!--<div class="col-xs-12 col-panel-profile">-->
                <!--<h5>作为乙方：我要接活</h5>-->
            <!--</div>-->
        <!--</div>-->

        <!--<div class="form-group">-->
            <!--<label for="inputAgent" class="col-xs-3 control-label sm-label">公司名称</label>-->
            <!--<div class="col-xs-9">-->
                <!--<input type="text" class="form-control" id="inputAgent" ng-model="user.agent_y" placeholder="没有可不填">-->
            <!--</div>-->
        <!--</div>-->
        <!--<div class="form-group">-->
            <!--<label for="inputAgentDesc" class="col-xs-3 control-label sm-label">公司简介</label>-->
            <!--<div class="col-xs-9">-->
                <!--<textarea rows="4" class="form-control" id="inputAgentDesc" ng-model="user.agent_y_desc" placeholder="200字以内，建议填写机构规模、机构人数、灵魂人物或代表作品。"></textarea>-->
            <!--</div>-->
        <!--</div>-->

        <!-- Jobs and duration -->
        <div class="form-group">
            <div class="col-xs-12 col-panel-profile">
                <h5>乙方：关注的岗位信息</h5>
            </div>
        </div>

        <div class="form-group">
            <div class="col-xs-12">
                <label for="inputJobs" class="control-label sm-label">岗位筛选（可多选）</label>
                <ul class="ul-tag" id="inputJobs">
                    <li ng-repeat="job in jobs" ng-class="{active: job.active == true}" ng-click="jobClick($index)">
                        {{ job.stat_name }}
                    </li>
                </ul>
            </div>
        </div>
        <hr/>
        <div class="form-group">
            <div class="col-xs-12">
                <label for="inputDuration" class="control-label sm-label">工作时限（可多选）</label>
                <ul class="ul-tag" id="inputDuration">
                    <li ng-repeat="duration in durations" ng-class="{active: duration.active == true}" ng-click="durationClick($index)">
                        {{ duration.name }}
                    </li>
                </ul>
            </div>
        </div>

        <div class="form-group">
            <div class="col-xs-12 center">
                <button type="submit" ng-click="submit()" class="btn btn-default btn-main" ng-disabled="incomplete">完成</button>
            </div>
        </div>

        <div class="form-group">
            <div class="col-xs-12 center">
                <p class="text-tips">完成个人资料填写后，建议尽快完善简历！ </p>
            </div>
        </div>
    </form>

    <!-- Modal Upload -->
    <div class="modal fade" id="uploadModal" tabindex="-1" role="dialog" aria-labelledby="ruploadModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <div class="modal-title" id="uploadModalLabel">
                        选取图片
                    </div>
                </div>
                <div class="modal-body">
                    <div class="step2">
                        <img id="preview"/>
                        <div class="info">
                            <!--<label>文件大小</label> <input type="text" id="filesize" name="filesize" />-->
                            <!--<label>类型</label> <input type="text" id="filetype" name="filetype" />-->
                            <!--<label>图像尺寸</label> <input type="text" id="filedim" name="filedim" />-->
                            <!--<label>x-off</label> <input type="text" id="x1_off" name="w" />-->
                            <!--<label>y-off</label> <input type="text" id="y1_off" name="h" />-->
                            <!--<label>x</label> <input type="text" id="x2_off" name="w" />-->
                            <!--<label>y</label> <input type="text" id="y2_off" name="h" />-->
                            <!--<label>宽度</label> <input type="text" id="w_off" name="w" />-->
                            <!--<label>高度</label> <input type="text" id="h_off" name="h" />-->
                        </div>
                    </div>
                </div>
                <div class="modal-footer btn-group-card">
                    <button type="button" class="btn" onclick="uploadImgCheck();">上传</button>
                    <a role="button" class="btn" data-dismiss="modal">取消</a>
                </div>
            </div>
        </div>
    </div>

</div>

<script src="__MOBILE__/js/jquery.Jcrop.min.js"></script>
<script src="__MOBILE__/js/edit_profile.js"></script>